import { useModel } from "@umijs/max";

export const useAccess = () => {
  const { initialState } = useModel("@@initialState");
  const { currentUser = {} } = initialState || {};
  const { permissions = [] } = currentUser as any;
  return { permissions };
};
